<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>搜索框</title>
    <style>
        * {
            margin: 0;
            padding: 0;
        }

        .box {
            padding: 20px;
        }

        .input {
            width: 200px;
            border: 1px solid #ddd;
            height: 1.9em;
            line-height: 1.9em;
            outline: none;
            padding-left: 0.5em;
        }

        .input:focus {
            outline: none;
            border: 1px solid #7bc2fb;
        }

        .input:hover {
            border: 1px solid #7bc2fb;
        }

        /*input:text不支持伪类*/
        .input::before {
            content: "";
            display: block;
            width: 16px;
            height: 16px;
            border: 1px solid #ddd;
        }
    </style>
</head>

<body>
    <div class="box">
        <input type="text" class="input">
    </div>

</body>

</html>